<!-- 试验数据绑定 -->
<template>
  <div class="app-container">
    <el-row :gutter="20">
      <el-col :span="show ? rowObj.T1 : rowObj.F1" :xs="show ? rowObj.T2 : rowObj.F2">
        <workSiteLeft ref="workSiteLeft" :show="show" @showLeft="showLeft" @queryVal="queryVal" />
      </el-col>
      <el-col :span="show ? rowObj.T3 : rowObj.F3" :xs="show ? rowObj.T4 : rowObj.F4">
        <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" style="display: flex;justify-content: space-between;">
          <div>
            <el-button style="margin-right: 6px" size="mini" :icon="show ? 'el-icon-s-fold' : 'el-icon-s-unfold'" circle @click="showLeft(show)"></el-button>
            <el-form-item label="试验类型">
              <el-radio-group @change="getList" v-model="queryParams.testType">
                <el-radio :label="1">延度</el-radio>
                <el-radio :label="2">软化点</el-radio>
                <el-radio :label="3">针入度</el-radio>
                <el-radio :label="4">燃烧炉</el-radio>
                <el-radio :label="5">马歇尔</el-radio>
              </el-radio-group>
            </el-form-item>

            <el-form-item label="是否合格" prop="eligible">
              <el-select style="width: 100px" v-model="queryParams.eligible" clearable size="mini" placeholder="请选择">
                <el-option v-for="item in eligibleList" :key="item.id" :label="item.name" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="试验时间">
              <deatetime ref="deatetime" v-model="queryParams.time"> </deatetime>
            </el-form-item>

            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['laboratoryManage:dataBinding:query']">搜索</el-button>
            <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
          </div>

          <el-form-item>
            <el-button icon="el-icon-connection" type="success" size="mini" @click="handleSave" v-hasPermi="['laboratoryManage:dataBinding:association']">关联</el-button>
          </el-form-item>
        </el-form>

        <div class="title">未关联数据</div>
        <el-table size="mini" tooltip-effect="dark" ref="multipleTable" v-if="queryParams.testType == 1" border
          v-loading="loading" :data="cementDataList" @selection-change="handleSelectionChange">
          <el-table-column align="center" type="selection" width="40" />
          <!-- <el-table-column label="所属单位" align="center" prop="deptName" show-overflow-tooltip width="115" /> -->
          <el-table-column label="所属试验室" align="center" prop="laboratoryName" show-overflow-tooltip width="90" />
          <el-table-column label="设备名称" align="center" prop="deviceName" show-overflow-tooltip min-width="165" />
          <el-table-column label="型号/规格" align="center" prop="model" show-overflow-tooltip min-width="80" />
          <el-table-column label="样品名称" align="center" show-overflow-tooltip min-width="80">
            <template slot-scope="scope"><span>{{ scope.row.sysl || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="技术要求" align="center" show-overflow-tooltip min-width="80">
            <template slot-scope="scope"><span>{{ scope.row.sysl || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="位移量(mm)" width="95" align="center">
            <template slot-scope="scope"><span>{{ scope.row.length1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="位移量(mm)" width="95" align="center">
            <template slot-scope="scope"><span>{{ scope.row.length2 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="位移量(mm)" width="95" align="center">
            <template slot-scope="scope"><span>{{ scope.row.length3 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="延伸速率(mm/min)" width="135" align="center">
            <template slot-scope="scope"><span>{{ scope.row.speed1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="延伸速率(mm/min)" width="135" align="center">
            <template slot-scope="scope"><span>{{ scope.row.speed2 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="当前温度(℃)" align="center" width="100">
            <template slot-scope="scope"><span>{{ scope.row.currTemp || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="设定温度值(℃)" align="center" width="110">
            <template slot-scope="scope"><span>{{ scope.row.setTemp || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="创建时间" align="center" width="135">
            <template slot-scope="scope"><span>{{ scope.row.createTime || "-" }}</span></template>
          </el-table-column>
        </el-table>

        <el-table tooltip-effect="dark" ref="multipleTable" v-if="queryParams.testType == 2" border v-loading="loading"
          :data="cementDataList" @selection-change="handleSelectionChange" size="mini">
          <el-table-column align="center" type="selection" width="40" />
          <el-table-column label="所属单位" align="center" prop="deptName" width="75" show-overflow-tooltip />
          <el-table-column label="所属试验室" align="center" prop="laboratoryName" width="90" show-overflow-tooltip />
          <el-table-column label="设备名称" align="center" prop="deviceName" min-width="120" show-overflow-tooltip />
          <el-table-column label="型号/规格" align="center" prop="model" min-width="80" show-overflow-tooltip />
          <el-table-column label="样品名称" align="center" min-width="75" show-overflow-tooltip>
            <template slot-scope="scope"><span>{{ scope.row.sampleName || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="技术要求" align="center" min-width="75" show-overflow-tooltip>
            <template slot-scope="scope"><span>{{ scope.row.jsyq || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="时间" align="center" width="120">
            <template slot-scope="scope"><span>{{ scope.row.time || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="试件编号1" align="center" min-width="85">
            <template slot-scope="scope"><span>{{ scope.row.num1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="温度1" align="center" min-width="70" show-overflow-tooltip>
            <template slot-scope="scope"><span>{{ scope.row.temp1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="试件编号2" align="center" min-width="85">
            <template slot-scope="scope"><span>{{ scope.row.num2 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="温度2" align="center" min-width="70" show-overflow-tooltip>
            <template slot-scope="scope"><span>{{ scope.row.temp2 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="创建时间" align="center" width="135">
            <template slot-scope="scope"><span>{{ scope.row.createTime || "-" }}</span></template>
          </el-table-column>
        </el-table>

        <el-table tooltip-effect="dark" ref="multipleTable" v-if="queryParams.testType == 3" border v-loading="loading"
          :data="cementDataList" @selection-change="handleSelectionChange" size="mini">
          <el-table-column align="center" type="selection" width="40" />
          <el-table-column label="所属单位" align="center" prop="deptName" width="115" show-overflow-tooltip />
          <el-table-column label="所属试验室" align="center" prop="laboratoryName" width="110" show-overflow-tooltip />
          <el-table-column label="设备名称" align="center" prop="deviceName" width="165" show-overflow-tooltip />
          <el-table-column label="型号/规格" align="center" prop="model" show-overflow-tooltip />
          <el-table-column label="样品名称" align="center">
            <template slot-scope="scope"><span>{{ scope.row.sampleName || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="技术要求" align="center">
            <template slot-scope="scope"><span>{{ scope.row.jsyq || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="实时位移" align="center">
            <template slot-scope="scope"><span>{{ scope.row.realTimeDisplacement || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="实时温度" align="center">
            <template slot-scope="scope"> <span>{{ scope.row.realTimeTemperature || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="创建时间" align="center" width="135">
            <template slot-scope="scope"><span>{{ scope.row.createTime || "-" }}</span></template>
          </el-table-column>
        </el-table>

        <el-table tooltip-effect="dark" ref="multipleTable" v-if="queryParams.testType == 4" border v-loading="loading"
          :data="cementDataList" @selection-change="handleSelectionChange" size="mini">
          <el-table-column align="center" type="selection" width="40" />
          <el-table-column label="所属单位" align="center" prop="deptName" width="115" show-overflow-tooltip />
          <el-table-column label="所属试验室" align="center" prop="deviceLaboratoryName" width="110" show-overflow-tooltip />
          <el-table-column label="设备名称" align="center" prop="deviceName" width="165" show-overflow-tooltip />
          <el-table-column label="型号/规格" align="center" prop="deviceModel" width="110" show-overflow-tooltip />
          <el-table-column label="时间" align="center">
            <template slot-scope="scope"><span>{{ scope.row.min + scope.row.second || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="初始重量" align="center">
            <template slot-scope="scope"><span>{{ scope.row.originalWeight || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="实时重量" align="center">
            <template slot-scope="scope"> <span>{{ scope.row.realTimeWeight || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="实时温度" align="center">
            <template slot-scope="scope"><span>{{ scope.row.realTimeTemp || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="创建时间" align="center" width="135">
            <template slot-scope="scope"><span>{{ scope.row.createTime || "-" }}</span></template>
          </el-table-column>
        </el-table>

        <el-table tooltip-effect="dark" ref="multipleTable" v-if="queryParams.testType == 5" border v-loading="loading"
          :data="cementDataList" @selection-change="handleSelectionChange" size="mini">
          <el-table-column align="center" type="selection" width="40" />
          <el-table-column label="所属单位" align="center" prop="deptName" width="115" show-overflow-tooltip />
          <el-table-column label="所属试验室" align="center" prop="deviceLaboratoryName" width="110" show-overflow-tooltip />
          <el-table-column label="设备名称" align="center" prop="deviceName" width="165" show-overflow-tooltip />
          <el-table-column label="型号/规格" align="center" prop="deviceModel" width="110" show-overflow-tooltip />
          <el-table-column label="样品名称" align="center">
            <template slot-scope="scope"><span>{{ scope.row.sampleName || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="技术要求" align="center">
            <template slot-scope="scope"><span>{{ scope.row.jsyq || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="稳定度" align="center">
            <template slot-scope="scope"><span>{{ scope.row.wd || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="流值(mm)" align="center">
            <template slot-scope="scope"><span>{{ scope.row.flux || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="创建时间" align="center" width="135">
            <template slot-scope="scope"><span>{{ scope.row.createTime || "-" }}</span></template>
          </el-table-column>
        </el-table>

        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
        
        <!-- 分分分分分 -->
        <div class="title color">已关联数据</div>
        <el-table border v-loading="loading2" :data="experimentBindingList" size="mini">
          <el-table-column label="序号" type="index" align="center" width="50" />
          <el-table-column label="试验编号" align="center" prop="testNum" min-width="100" show-overflow-tooltip />
          <el-table-column label="试验类型" align="center" prop="testType" min-width="90" show-overflow-tooltip />
          <el-table-column label="试验日期" align="center" min-width="135" show-overflow-tooltip>
            <template slot-scope="scope"><span>{{ scope.row.createTime || "-" }}</span></template>
          </el-table-column>
          <!-- 延度S -->
          <el-table-column label="位移量(mm)" v-if="queryParams.testType == 1" width="100" align="center">
            <template slot-scope="scope"><span>{{ scope.row.length1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="位移量(mm)" v-if="queryParams.testType == 1" width="100" align="center">
            <template slot-scope="scope"><span>{{ scope.row.length2 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="位移量(mm)" v-if="queryParams.testType == 1" width="100" align="center">
            <template slot-scope="scope"><span>{{ scope.row.length3 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="延伸速率(mm/min)" v-if="queryParams.testType == 1" align="center" width="140">
            <template slot-scope="scope"><span>{{ scope.row.speed1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="延伸速率(mm/min)" v-if="queryParams.testType == 1" align="center" width="140">
            <template slot-scope="scope"><span>{{ scope.row.speed2 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="当前温度(℃)" v-if="queryParams.testType == 1" align="center" width="110">
            <template slot-scope="scope"><span>{{ scope.row.currTemp || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="设定温度值(℃)" v-if="queryParams.testType == 1" align="center" width="110">
            <template slot-scope="scope"><span>{{ scope.row.setTemp || "-" }}</span></template>
          </el-table-column>
          <!-- 延度E-->

          <!-- 软化点S-->
          <el-table-column label="时间" v-if="queryParams.testType == 2" align="center">
            <template slot-scope="scope"><span>{{ scope.row.time || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="试件编号1" v-if="queryParams.testType == 2" align="center">
            <template slot-scope="scope"><span>{{ scope.row.num1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="温度1" v-if="queryParams.testType == 2" align="center">
            <template slot-scope="scope"><span>{{ scope.row.temp1 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="试件编号2" v-if="queryParams.testType == 2" align="center">
            <template slot-scope="scope"><span>{{ scope.row.num2 || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="温度2" v-if="queryParams.testType == 2" align="center">
            <template slot-scope="scope"><span>{{ scope.row.temp2 || "-" }}</span></template>
          </el-table-column>
          <!-- 软化点E-->

          <!-- 针入度S-->
          <el-table-column label="实时位移" v-if="queryParams.testType == 3" align="center">
            <template slot-scope="scope"><span>{{ scope.row.realTimeDisplacement || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="实时温度" v-if="queryParams.testType == 3" align="center">
            <template slot-scope="scope"><span>{{ scope.row.realTimeTemperature || "-" }}</span></template>
          </el-table-column>
          <!-- 针入度E-->

          <!-- 燃烧炉S-->
          <el-table-column v-if="queryParams.testType == 4" label="时间" align="center">
            <template slot-scope="scope"><span>{{ scope.row.min + scope.row.second || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="初始重量" v-if="queryParams.testType == 4" align="center">
            <template slot-scope="scope"><span>{{ scope.row.originalWeight || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="实时重量" v-if="queryParams.testType == 4" align="center">
            <template slot-scope="scope"><span>{{ scope.row.realTimeWeight || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="实时温度" v-if="queryParams.testType == 4" align="center">
            <template slot-scope="scope"><span>{{ scope.row.realTimeTemp || "-" }}</span></template>
          </el-table-column>
          <!-- 燃烧炉 -->

          <!-- 马歇尔S -->
          <el-table-column label="样品名称" v-if="queryParams.testType == 5" align="center">
            <template slot-scope="scope"><span>{{ scope.row.sampleName || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="技术要求" v-if="queryParams.testType == 5" align="center">
            <template slot-scope="scope"><span>{{ scope.row.jsyq || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="稳定度" v-if="queryParams.testType == 5" align="center">
            <template slot-scope="scope"><span>{{ scope.row.wd || "-" }}</span></template>
          </el-table-column>
          <el-table-column label="流值(mm)" v-if="queryParams.testType == 5" align="center">
            <template slot-scope="scope"><span>{{ scope.row.flux || "-" }}</span></template>
          </el-table-column>
          <!-- 马歇尔E-->

          <el-table-column label="是否合格" align="center" fixed="right" show-overflow-tooltip>
            <template slot-scope="scope">
              <el-tag v-if="scope.row.eligible == 0" type="danger">不合格</el-tag>
              <el-tag type="success" v-else>合格</el-tag>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" align="center" width="100">
            <template slot-scope="scope">
              <el-button @click.native.prevent="deleteRow(scope.row)" type="text" size="small" v-hasPermi="['laboratoryManage:dataBinding:unbind']">解除绑定</el-button>  
            </template>
          </el-table-column>
        </el-table>
        <pagination v-show="total2 > 0" :total="total2" :page.sync="queryParams2.pageNum" :limit.sync="queryParams2.pageSize" @pagination="getAssociationList" />
      </el-col>
    </el-row>

    <!-- 关联数据 -->
    <el-dialog title="关联数据" :visible.sync="rowDetailsDialog" width="35%">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="试验类型" prop="testType">
          <el-select v-model="ruleForm.testType" clearable size="mini" placeholder="请选择">
            <el-option v-for="item in askSelectListData" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
          <el-button @click="resetForm('ruleForm')">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
import workSiteLeft from "@/views/components/workSiteLeft";
import { ductilityDataList } from "@/api/laboratoryManage/ductilityData";
import { softeningPointDataList } from "@/api/laboratoryManage/softeningPointData";
import { penetrationDataList } from "@/api/laboratoryManage/penetrationData";
import { combustionFurnaceDataList } from "@/api/laboratoryManage/combustionFurnaceData";
import { marshallDataList } from "@/api/laboratoryManage/marshallData";

import {
  experimentBindingPage,
  askSelectList,
  experimentBinding,
  unbind,
  mxrSelectList,
  rslSelectList,
} from "@/api/laboratoryManage/dataBinding";

import deatetime from "@/components/Datetime";

export default {
  name: "dataBinding", //试验数据绑定
  data() {
    return {
      askSelectListData: [],
      rules: {
        testType: [
          { required: true, message: "请选择活动区域", trigger: "change" },
        ],
      },
      ruleForm: {},
      deptName: "济微公司",
      experimentBindingList: [], //已绑定
      multipleSelection: [],
      eligibleList: [
        { id: "0", name: "不合格" },
        { id: "1", name: "合格" },
      ],
      stateList: [
        { id: "0", name: "未关联" },
        { id: "1", name: "已关联" },
      ],
      show: true,
      rowObj: {
        T1: 3,
        T2: 24,
        T3: 21,
        T4: 24,
        F1: 0,
        F2: 0,
        F3: 24,
        F4: 24,
      },
      equipmentList: [],
      rowDetailsDialog: false,
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      cementDataList: [],
      // 弹出层标题
      title: "",
      // 查询参数
      queryParams: {
        relevance: 0, //未关联
        testType: 1, //1-5,延度1，软化点2，针入度3，燃烧炉4，马歇尔5
        pageNum: 1,
        pageSize: 10,
      },
      queryParams2: {
        type: 1, //1-5,延度1，软化点2，针入度3，燃烧炉4，马歇尔5
        pageNum: 1,
        pageSize: 10,
      },
      total2: 0,
      loading2: true,
    };
  },
  components: {
    workSiteLeft,
    deatetime,
  },
  created() {
    this.getList();
    // this.getAssociationList();
  },
  methods: {
    getList(val) {
      this.queryParams2.type = val || this.queryParams.testType;
      this.getAssociationList();
      switch (this.queryParams.testType || val) {
        case 1:
          this.loading = true;
          ductilityDataList(this.queryParams).then((response) => {
            this.cementDataList = response.data.records;
            this.total = response.data.total;
            this.loading = false;
          });
          break;
        case 2:
          this.loading = true;
          softeningPointDataList(this.queryParams).then((response) => {
            this.cementDataList = response.data.records;
            this.total = response.data.total;
            this.loading = false;
          });
          break;
        case 3:
          this.loading = true;
          penetrationDataList(this.queryParams).then((response) => {
            this.cementDataList = response.data.records;
            this.total = response.data.total;
            this.loading = false;
          });
          break;
        case 4:
          this.loading = true;
          combustionFurnaceDataList(this.queryParams).then((response) => {
            this.cementDataList = response.rows;
            this.total = response.total;
            this.loading = false;
          });
          break;
        case 5:
          this.loading = true;
          marshallDataList(this.queryParams).then((response) => {
            this.cementDataList = response.rows;
            this.total = response.total;
            this.loading = false;
          });
          break;
      }
    },
    getAssociationList() {
      this.loading2 = true;
      experimentBindingPage(this.queryParams2).then((res) => {
        this.experimentBindingList = res.rows;
        this.total2 = res.total;
        this.loading2 = false;
      });
    },
    handleSelectionChange(val) {
      console.log(val);
      this.multipleSelection = val;
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams = this.getSearchParams();
      this.queryParams2 = this.getSearchParams();
      this.queryParams.pageNum = 1;
      this.queryParams2.pageNum = 1;
      this.getList();
    },
    getSearchParams() {
      const params = {};
      for (const key in this.queryParams) {
        if (key === "time") {
          const time = this.queryParams[key];
          if (time && time.length === 2) {
            params.startTime = time[0];
            params.endTime = time[1];
          }
        } else {
          params[key] = this.queryParams[key];
        }
      }
      return params;
    },

    handleSave() {
      if (!this.multipleSelection.length) {
        return this.$message.error("请先选择您要关联的数据！！！");
      } else {
        if (this.queryParams.testType == 4) {
          rslSelectList().then((res) => {
            this.askSelectListData = res.rows;
          });
        } else if (this.queryParams.testType == 5) {
          mxrSelectList().then((res) => {
            this.askSelectListData = res.rows;
          });
        } else {
          var obj = {
            1: 'YD', //延度——  YD
            2: 'RHD', //软化点——  RHD
            3: 'ZRD', //针入度——   ZRD
          }
          askSelectList({
            type: obj[Number(this.queryParams.testType)]
          }).then((res) => {
            this.askSelectListData = res.data;
          });
        }
        this.rowDetailsDialog = true;
      }
    },
    // 绑定确定
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          let obj = {
            deptName: this.deptName,
            type: this.queryParams.testType,
            testType: this.queryName(this.ruleForm.testType),
            testTypeId: this.ruleForm.testType,
            ids: this.multipleSelection.map((v) => (v = v.id)),
          };
          // console.log(obj);
          experimentBinding(obj).then((res) => {
            this.$message.success("数据关联成功！！！");
            this.resetForm("ruleForm");
            this.getList();
          });
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    // 解除绑定
    deleteRow(row) {
      this.$confirm("确定要解除绑定吗？, 是否继续?", "解除绑定提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          unbind(row.id).then((res) => {
            this.$message({
              type: "success",
              message: "解除绑定成功!",
            });
            this.getList();
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    queryName(e) {
      let arr = this.askSelectListData.filter((item) => {
        return item.id === e;
      });
      return arr[0].name;
    },

    resetForm(formName) {
      this.$refs[formName].resetFields();
      this.rowDetailsDialog = false;
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.deptName = "济微公司";
      this.$refs.workSiteLeft.resetQuery();
      this.$refs.deatetime.startTime = null;
      this.$refs.deatetime.endTime = null;
      this.queryParams.time = [];
      this.queryParams.id = "";
      this.queryParams.startTime = "";
      this.queryParams.endTime = "";
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handleClose() {
      this.$confirm("确认关闭？")
        .then((_) => {
          F;
          done();
        })
        .catch((_) => { });
    },
    showLeft(show) {
      this.show = !show;
    },
    queryVal(val) {
      this.deptName = val.label;
      this.queryParams.id = val.id;
      this.handleQuery();
    },
  },
};
</script>
<style scoped lang="scss">
.app-container {
  // padding-top: 16px;
  // user-select: none;

  .title {
    color: #ce9178;
    display: flex;
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
  }

  .color {
    color: #438a49;
  }
}
</style>

